/**
 * Created by Administrator on 2019/3/1.
 */
function nameChecked(obj) {
    // var obj = document.getElementById('username');

    console.log(obj.value);

    var nameTips = document.getElementById('nameTips');

    username = obj.value; //xxfjalsdfjlasjdf

    var reg = /^1[0-9]{10}$/;

    if (reg.test(username)) {
        console.log('符合规则');
    }
    else {
        console.log('不符合规则');
        nameTips.style.display = 'block';
    }
}

function psChecked(obj) {
    var psTips = document.getElementById('psTips');

    if (obj.value == 123) {
        console.log('符合规则');
    }
    else {
        console.log('不符合规则');
        psTips.style.display = 'block';
    }
}

function capChecked(obj) {

    var psTips = document.getElementById('capTips');

    if (obj.value == 'nk6p') {
        console.log('符合规则');
    }
    else {
        console.log('不符合规则');
        capTips.style.display = 'block';
    }
}


function clearTips(str) {

    var obj = document.getElementById(str);

    if (str == 'nameTips') {
        obj.style.display = 'none';
        return;
    }

    if (str == 'psTips') {
        obj.style.display = 'none';
        return;
    }

    if (str == 'capTips') {
        obj.style.display = 'none';
        return;
    }

}

function sendInfo() {
    var u = (document.getElementById('nameTips')).style.display;
    var p = (document.getElementById('psTips')).style.display;
    var c = (document.getElementById('capTips')).style.display;


    if ((u == 'none') && (p == 'none') && (c == 'none')) {
        return true;
    }
    else {
        return false;
    }
}


